import requests
import execjs

with open('DecryptCodeBiao.js', encoding='utf-8') as file:
    js_code = file.read()
ctx = execjs.compile(js_code)

cookies = {
    'Hm_lvt_b966fe201514832da03dcf6cbf25b8a2': '1725321048,1726486337,1726554197',
    'HMACCOUNT': 'E3DA92CCA15F8725',
    'acw_tc': '1a0c639f17265596222926543e003bce7df395d3e8c03aafd3a80d66459a6f',
    'Hm_lpvt_b966fe201514832da03dcf6cbf25b8a2': '1726559622',
    '_c_WBKFRo': 'cacQKaiDGZEwIFafayOk6U3vu9vac9R4c3Gk8H3V',
    '_nb_ioWEgULi': '',
    'acw_sc__v3': '66e9358bc96431ddee15cbe191a945925b936db0',
    'ssxmod_itna': 'eq0OGKBKDKiK0I94BaqBRR9IweeWu5itNDuniWbQ10x0y0yeGzDAxn40iDt=1siG+mKsFeRa2bC/WShd4NtDMq3mNYB8rFFTDCPGnDB9EoLDentD5xGoDPxDeDAjqGaDb4Dr9=qGpycukXybqGRD0YDzqDgD7Q45eDfDDLyKBh+mkxD0khtH7DqPreDbg=l/br4OeDS3xXxKB=DjqGgDBLNj1hyDDUku1xV0ua75cpnierDtqD9znU07n4gDWNuK64E8APhFgq73EDrt7hI8EE+lBDr3h+bbBGxFieWG+woA7DlxD3pRHD==',
    'ssxmod_itna2': 'eq0OGKBKDKiK0I94BaqBRR9IweeWu5itNDuniWbQ1DnFkboDsqdNsDLWUjG5dqApK5017GUxx5CnAUP6DQ94ODFqG7deD===',
}

headers = {
    'Accept': 'application/json, text/plain, */*',
    'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
    'Connection': 'keep-alive',
    # 'Cookie': 'Hm_lvt_b966fe201514832da03dcf6cbf25b8a2=1725321048,1726486337,1726554197; HMACCOUNT=E3DA92CCA15F8725; acw_tc=1a0c639f17265596222926543e003bce7df395d3e8c03aafd3a80d66459a6f; Hm_lpvt_b966fe201514832da03dcf6cbf25b8a2=1726559622; _c_WBKFRo=cacQKaiDGZEwIFafayOk6U3vu9vac9R4c3Gk8H3V; _nb_ioWEgULi=; acw_sc__v3=66e9358bc96431ddee15cbe191a945925b936db0; ssxmod_itna=eq0OGKBKDKiK0I94BaqBRR9IweeWu5itNDuniWbQ10x0y0yeGzDAxn40iDt=1siG+mKsFeRa2bC/WShd4NtDMq3mNYB8rFFTDCPGnDB9EoLDentD5xGoDPxDeDAjqGaDb4Dr9=qGpycukXybqGRD0YDzqDgD7Q45eDfDDLyKBh+mkxD0khtH7DqPreDbg=l/br4OeDS3xXxKB=DjqGgDBLNj1hyDDUku1xV0ua75cpnierDtqD9znU07n4gDWNuK64E8APhFgq73EDrt7hI8EE+lBDr3h+bbBGxFieWG+woA7DlxD3pRHD==; ssxmod_itna2=eq0OGKBKDKiK0I94BaqBRR9IweeWu5itNDuniWbQ1DnFkboDsqdNsDLWUjG5dqApK5017GUxx5CnAUP6DQ94ODFqG7deD===',
    'Referer': 'https://ctbpsp.com/',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0',
    'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Microsoft Edge";v="122"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
}

params = {
    'province': '',
    'industry': '',
    'type__1017': 'n4+xnDBDgDcDy0DRDxlxGhbCrG=QI450Q+e+KO4D',
}

response = requests.get(
     'https://ctbpsp.com/cutominfoapi/recommand/type/5/pagesize/10/currentpage/1',
    params=params,
    cookies=cookies,
    headers=headers,
).text.replace('"','')
# print(response)
t = response +''
text = ctx.call('decryptByDES',t)
print(text)